<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>学生课表</title>
    <link href="../../css/bootstrap.min.css" rel="stylesheet"/>
    <link href="../../css/font-awesome.css" rel="stylesheet"/>

    <!-- Data Tables -->
    <link href="../../css/style.css" rel="stylesheet"/>
    <style type="text/css">
        table {
            margin: 0 auto;
            text-align: center;
            font-size: 18px;
        }

        tr, td, th {
            min-width: 200px;
            text-align: center;
        }

    </style>
</h:head>
<h:body>
    <h:form>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox-title">
                        <h5>课表</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                            </a> <a class="dropdown-toggle" data-toggle="dropdown"
                                    href="table_basic.html#"> <i class="fa fa-wrench"></i>
                        </a> <a class="close-link"> <i class="fa fa-times"></i>
                        </a>
                        </div>
                    </div>
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <!-- 按照列优先遍历 courseEntity[0].name 相当于是 courseEntity[][0].name，遍历第一列 -->
                            <h:dataTable value="#{course.curriculum(user.id)}" first="0" rows="5" rules="all"
                                         var="courseEntity" cellpadding="5" width="100%" id="courseEntity"
                                         class="table table-striped table-bordered table-hover dataTable">
                                <h:column>
                                    <f:facet name="header">节数</f:facet>
                                    <h:outputText value="#{courseEntity[7].name}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期一</f:facet>
                                    <h:outputText value="#{courseEntity[0].name}"/><br/>
                                    <h:outputText value="#{courseEntity[0].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[0].week}"/><br/>
                                    <h:outputText value="#{courseEntity[0].address}"/><br/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期二</f:facet>
                                    <h:outputText value="#{courseEntity[1].name}"/><br/>
                                    <h:outputText value="#{courseEntity[1].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[1].week}"/><br/>
                                    <h:outputText value="#{courseEntity[1].address}"/><br/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期三</f:facet>
                                    <h:outputText value="#{courseEntity[2].name}"/><br/>
                                    <h:outputText value="#{courseEntity[2].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[2].week}"/><br/>
                                    <h:outputText value="#{courseEntity[2].address}"/><br/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期四</f:facet>
                                    <h:outputText value="#{courseEntity[3].name}"/><br/>
                                    <h:outputText value="#{courseEntity[3].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[3].week}"/><br/>
                                    <h:outputText value="#{courseEntity[3].address}"/><br/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期五</f:facet>
                                    <h:outputText value="#{courseEntity[4].name}"/><br/>
                                    <h:outputText value="#{courseEntity[4].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[4].week}"/><br/>
                                    <h:outputText value="#{courseEntity[4].address}"/><br/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期六</f:facet>
                                    <h:outputText value="#{courseEntity[5].name}"/><br/>
                                    <h:outputText value="#{courseEntity[5].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[5].week}"/><br/>
                                    <h:outputText value="#{courseEntity[5].address}"/><br/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">星期日</f:facet>
                                    <h:outputText value="#{courseEntity[6].name}"/><br/>
                                    <h:outputText value="#{courseEntity[6].teacher}"/><br/>
                                    <h:outputText value="#{courseEntity[6].week}"/><br/>
                                    <h:outputText value="#{courseEntity[6].address}"/><br/>
                                </h:column>
                            </h:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </h:form>
</h:body>
</html>
